package com.xiaoli.userserver.controller;

import com.xiaoli.userserver.entity.User;
import com.xiaoli.userserver.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @Autowired
    private IUserService userService;

    @PostMapping("saveUser")
    public User insertUser(@RequestBody User user) {
        userService.save(user);
        return user;
    }
}
